Skip to content

Conversation

@HyukjinKwon
Copy link
Member

@HyukjinKwon HyukjinKwon commented Jan 9, 2026

Rationale for this change

The XXX comment in SharedExclusiveChecker noted that error messages were too generic and didn't describe the actual operations involved.

Shared lock:

ReadAt():

Result<int64_t> ReadAt(int64_t position, int64_t nbytes, void* out) final {
auto guard = lock_.shared_guard();
return derived()->DoReadAt(position, nbytes, out);

Result<std::shared_ptr<Buffer>> ReadAt(int64_t position, int64_t nbytes) final {
auto guard = lock_.shared_guard();
return derived()->DoReadAt(position, nbytes);

GetSize():

Result<int64_t> GetSize() final {
auto guard = lock_.shared_guard();
return derived()->DoGetSize();

Exclusive lock:

Read():

Result<int64_t> Read(int64_t nbytes, void* out) final {
auto guard = lock_.exclusive_guard();
return derived()->DoRead(nbytes, out);

Result<std::shared_ptr<Buffer>> Read(int64_t nbytes) final {
auto guard = lock_.exclusive_guard();
return derived()->DoRead(nbytes);

Result<int64_t> Read(int64_t nbytes, void* out) final {
auto guard = lock_.exclusive_guard();
return derived()->DoRead(nbytes, out);

Result<std::shared_ptr<Buffer>> Read(int64_t nbytes) final {
auto guard = lock_.exclusive_guard();
return derived()->DoRead(nbytes);

Seek():

Status Seek(int64_t position) final {
auto guard = lock_.exclusive_guard();
return derived()->DoSeek(position);

Tell():

Result<int64_t> Tell() const final {
auto guard = lock_.exclusive_guard();
return derived()->DoTell();

Result<int64_t> Tell() const final {
auto guard = lock_.exclusive_guard();
return derived()->DoTell();

Peek():

Result<std::string_view> Peek(int64_t nbytes) final {
auto guard = lock_.exclusive_guard();
return derived()->DoPeek(nbytes);

Result<std::string_view> Peek(int64_t nbytes) final {
auto guard = lock_.exclusive_guard();
return derived()->DoPeek(nbytes);

Close():

Status Close() final {
auto guard = lock_.exclusive_guard();
return derived()->DoClose();

Status Close() final {
auto guard = lock_.exclusive_guard();
return derived()->DoClose();

Abort():

Status Abort() final {
auto guard = lock_.exclusive_guard();
return derived()->DoAbort();

Status Abort() final {
auto guard = lock_.exclusive_guard();
return derived()->DoAbort();

What changes are included in this PR?

Improved three error messages in SharedExclusiveChecker to explicitly list the I/O operations involved:

  • Shared lock operations: ReadAt, GetSize
  • Exclusive lock operations: Read, Seek, Tell, Peek, Close, Abort

Are these changes tested?

I manually tested all of combinations.

Are there any user-facing changes?

No.

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

⚠️ GitHub issue #48799 has been automatically assigned in GitHub to PR creator.

@HyukjinKwon HyukjinKwon force-pushed the improve-io-error-messages branch from 7be5a89 to 71c032a Compare January 9, 2026 07:33
Copy link
Member

@pitrou pitrou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, looks like a simple and obvious improvement

@pitrou pitrou merged commit 6657a92 into apache:main Jan 12, 2026
49 checks passed
@pitrou pitrou removed the awaiting review Awaiting review label Jan 12, 2026
@github-actions github-actions bot added the awaiting committer review Awaiting committer review label Jan 12, 2026
@conbench-apache-arrow
Copy link

After merging your PR, Conbench analyzed the 3 benchmarking runs that have been run so far on merge-commit 6657a92.

There weren't enough matching historic benchmark results to make a call on whether there were regressions.

The full Conbench report has more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants